package HOME_WORK;

/**
 * @author 小李要吃鱼
 * @date 2021-01-13 19:22
 */
public class class2 {
    public static void main(String args[]){
//        转换以下10进制为2进制：17(10)  64(10)  -9(10)，并写程序检验
        int i1 = 17;
        System.out.println(Integer.toBinaryString(i1));
        i1 = 64;
        System.out.println(Integer.toBinaryString(i1));
        i1 = -9;
        System.out.println(Integer.toBinaryString(i1));


//        转换238, 167, 135 为二进制, 16进制, 并写程序检验
        int i2 = 238;
        System.out.println(Integer.toBinaryString(i2));
        System.out.println(Integer.toHexString(i2));
        i2 = 167;
        System.out.println(Integer.toBinaryString(i2));
        System.out.println(Integer.toHexString(i2));
        i2 = 135;
        System.out.println(Integer.toBinaryString(i2));
        System.out.println(Integer.toHexString(i2));
    }
}

